/* ========================================================================= */
/* ------------------------------------------------------------------------- */
/*!
  \file			env.h
  \date			Jan 2012
  \author		TNick

  \brief		Contains the definition for Env class


*//*


 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 Please read COPYING and README files in root folder
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
/* ------------------------------------------------------------------------- */
/* ========================================================================= */
#ifndef __ENV_INC__
#define __ENV_INC__
//
//
//
//
/*  INCLUDES    ------------------------------------------------------------ */

#include	<QHash>
#include	<QString>
#include	<QStringList>

/*  INCLUDES    ============================================================ */
//
//
//
//
/*  CLASS    --------------------------------------------------------------- */

/**
*	@brief
*/
class Env		: public QHash<QString, QString>		{

	//
	//
	//
	//
	/*  DEFINITIONS    ----------------------------------------------------- */




	/**
	*	@brief	Predefined environment values
	*/
	enum		Predef		{

		/**
		*	@brief	the path and name of the source file that created the environment
		*/
		PREDEV_SRCFILE = 0,

		/**
		*	@brief	the path of the source file that created the environment without name
		*/
		PREDEV_SRCPATH,

		/**
		*	@brief	name of the source file that created the environment without path or extension
		*/
		PREDEV_SRCFILENAME,

		/**
		*	@brief	the current path when the environment was created
		*/
		PREDEV_CRTPATH,

		/**
		*	@brief	Year when the environment was created
		*/
		PREDEV_YEAR,

		/**
		*	@brief	Month (numeric) when the environment was created
		*/
		PREDEV_MONTH,

		/**
		*	@brief	Day (numeric) when the environment was created
		*/
		PREDEV_DAY,

		/**
		*	@brief	Hour (numeric) when the environment was created
		*/
		PREDEV_HOUR,

		/**
		*	@brief	Minute when the environment was created
		*/
		PREDEV_MIN,

		/**
		*	@brief	Second when the environment was created
		*/
		PREDEV_SEC,

		/**
		*	@brief	Milisecond when the environment was created
		*/
		PREDEV_MSEC,


		/**
		*	@brief	index of first variable outside environment
		*/
		PREDEV_MAX
	};







	/*  DEFINITIONS    ===================================================== */
	//
	//
	//
	//
	/*  DATA    ------------------------------------------------------------ */

private:

	/**
	*	@brief	names of predefined values
	*/
	static const char *			predef_names_[PREDEV_MAX];

	/*  DATA    ============================================================ */
	//
	//
	//
	//
	/*  FUNCTIONS    ------------------------------------------------------- */

private:

	/**
	*	@brief	constructor;
	*/
	Env					( const QString & s_file );

public:

	/**
	*	@brief	destructor;
	*/
	virtual				~Env		( void );


private:

	/**
	*	@brief	get the informations from coresponding file
	*/
	bool				interpretLines		(
			QStringList &	input_lines
			);







public:

	/**
	*	@brief	creates a new environment from a source file
	*/
	static Env *		loadFile	(
			QString			s_path
			);



private:

	/**
	*	@brief	returns only meaningfull lines from a file
	*/
	static bool			readSourceFile		(
			QString			s_path,
			QStringList &	input_lines
			);


	/*  FUNCTIONS    ======================================================= */
	//
	//
	//
	//

};	/*	class Env	*/

/*  CLASS    =============================================================== */
//
//
//
//
#endif // __ENV_INC__
/* ------------------------------------------------------------------------- */
/* ========================================================================= */
